import request from '@/utils/request'
import { ref } from 'vue'
export default () => {
	const groupschedules = ref([])
	const groupschedule = ref({
		Groupsigns:[],
		Groupcourse:{},
		employee:{},
		appointment_amount:0,
		current_sign_amount:0,
		sign_amount:0,
		start_time:"",
		end_time:"",
		color:"",
		title:"",
		employee_id:0,
		groupcourse_id:0,
		Groupappointments:[]
	})
	const getGroupschedule = async (daystr) => {
		groupschedules.value = await request.get(`mini/groupschedule?day=${daystr}`)
	}

	const loadGroupschedule = async (id) => {
		groupschedule.value = await request.get(`mini/groupschedule/${id}`)
	}
	
	return {
		groupschedules,
		groupschedule,
		loadGroupschedule,
		getGroupschedule
	}
}